//
//	  UserInterface.java
//
//	  Copyright (c) 2011 <John Lawniczak>
//	  jlawniczak340license@gmail.com
//
//    This file is part of CS102_Assignment3.
//
//    CS102_Assignment3 is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, version 3 of the License.
//
//    CS102_Assignment3 is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with CS102_Assignment3.  If not, see <http://www.gnu.org/licenses/>.
//

/**************************************************
Class Name: UserInterface 
Author's Name: John Lawniczak
Date: 05-19-2010
Description of the class: the user interface for the assignment 3
***************************************/

import java.util.Scanner;

public class UserInterface {
	private Scanner in = new Scanner(System.in);
	/**************************************************
	Constructor
	Input to the method: none
	Output(Return value): none
	Description: starts the UI  
	Author: John Lawniczak
	**************************************************/	
	public UserInterface(){
		this.runUI();
	}
	
	/**************************************************
	Method name: runUI
	Input to the method: none
	Output(Return value): none
	Brief Description: runs a cmd line ui  
	Author: John Lawniczak
	**************************************************/
	public void runUI(){
		String inNum1 = "";
		String inNum2;
		do{
			System.out.println("start entering a number that doesn't begin in 0 and ends in a period: ");
			inNum1 = in.next();
		}while(!inNum1.endsWith("."));
		
		do{
			System.out.println("start entering a number that doesn't begin in 0 and ends in a period: ");
			inNum2 = in.next();
		}while(inNum2.matches("\\d*"));
		
		System.out.println("product: " + new LargeNumber(inNum1).MultiplyByLargeNumber(new LargeNumber(inNum2)));
	}
}
